import org.scalatra.sbt._
import org.scalatra.sbt.PluginKeys._
import com.mojolly.scalate.ScalatePlugin._
import ScalateKeys._
import com.bowlingx.sbt.plugins.Wro4jPlugin._
import Wro4jKeys._


val ScalatraVersion = "2.5.0"

ScalatraPlugin.scalatraSettings

scalateSettings

organization := "com.rectcircle"

name := "scalatratest"

version := "0.1.0-SNAPSHOT"

scalaVersion := "2.11.8"

resolvers += Classpaths.typesafeReleases

libraryDependencies ++= Seq(
  "org.scalatra" %% "scalatra" % ScalatraVersion,
  "org.scalatra" %% "scalatra-scalate" % ScalatraVersion,
  "org.scalatra" %% "scalatra-specs2" % ScalatraVersion % "test",
  "org.scalatra" %% "scalatra-auth" % ScalatraVersion,
  
  "org.scalatra" %% "scalatra-scalatest" % ScalatraVersion % "test",
  
  "org.scalatra" %% "scalatra-commands" % ScalatraVersion,
  
  "org.scalatra" %% "scalatra-swagger"  % "2.5.0",
  
  "com.typesafe.akka" %% "akka-actor" % "2.3.4",
  "net.databinder.dispatch" %% "dispatch-core" % "0.11.3",

  "org.scalatra" %% "scalatra-atmosphere" % ScalatraVersion,
  "org.json4s" %% "json4s-jackson" % "3.5.0",
  "org.json4s"   %% "json4s-native" % "3.5.0",
  
  "org.scalatra" %% "scalatra-metrics" % ScalatraVersion,
  
  "org.squeryl" %% "squeryl" % "0.9.5-7",
  "mysql" % "mysql-connector-java" % "5.1.38",
  "c3p0" % "c3p0" % "0.9.1.2",
  "org.slf4j" % "slf4j-api" % "1.7.21",

  "ch.qos.logback" % "logback-classic" % "1.1.5" % "runtime",
  "org.eclipse.jetty" % "jetty-webapp" % "9.2.15.v20160210" % "container",
  "javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided"
)

scalateTemplateConfig in Compile := {
  val base = (sourceDirectory in Compile).value
  Seq(
    TemplateConfig(
      base / "webapp" / "WEB-INF" / "templates",
      Seq.empty,  /* default imports should be added here */
      Seq(
        Binding("context", "_root_.org.scalatra.scalate.ScalatraRenderContext", importMembers = true, isImplicit = true)
      ),  /* add extra bindings here */
      Some("templates")
    )
//    ,
//    TemplateConfig(
//      base / "scala" / "com" ,
//      Seq.empty,
//      Seq(
//        Binding("context", "_root_.org.scalatra.scalate.ScalatraRenderContext", importMembers = true, isImplicit = true)
//      ),  /* add extra bindings here */
//      Some("com")
//    )
  )
}


//// import task settings
//seq(wro4jSettings: _*)
//
//// If you use xsbt-web-plugin, this will add compiled files to your war file:
//(webappResources in Compile) <+= (targetFolder in generateResources in Compile)


enablePlugins(JettyPlugin)
